System, method and computer program product for monitoring data activity utilizing a shared data store

ABSTRACT

In accordance with embodiments, there are provided mechanisms and methods for monitoring data activity utilizing a shared data store. These mechanisms and methods for monitoring data activity utilizing a shared data store can enable enhanced data monitoring, more efficient data storage, improved system resource utilization, etc.

CLAIM OF PRIORITY

This application is a continuation of U.S. application Ser. No.13/865,870, filed Apr. 18, 2013 and U.S. application Ser. No.13/865,879, filed Apr. 18, 2013, which are continuations of U.S.application Ser. No. 13/034,690, filed Feb. 24, 2011, which claims thebenefit of U.S. Provisional Patent Application No. 61/307,790, filedFeb. 24, 2010, the entire contents of which are incorporated herein byreference.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

FIELD OF THE INVENTION

One or more implementations relate generally to activity associated withdata, and more particularly to monitoring that activity.

BACKGROUND

The subject matter discussed in the background section should not beassumed to be prior art merely as a result of its mention in thebackground section. Similarly, a problem mentioned in the backgroundsection or associated with the subject matter of the background sectionshould not be assumed to have been previously recognized in the priorart. The subject matter in the background section merely representsdifferent approaches, which in and of themselves may also be inventions.

Conventional systems (e.g., multi-tenant on-demand database systems,etc.) commonly perform monitoring of data activity within the system.For example, local data within the system may be collected and stored toa local database. Unfortunately, techniques for storing and utilizingthe collected data have been associated with various limitations.

Just by way of example, traditional methods of collecting and storingmonitored data in a local database create a considerable load on thedatabase and result in the retrieval of data that may be stale and lessuseful. Accordingly, it is desirable to provide techniques that improvethe storage and utilization of monitored system data.

BRIEF SUMMARY

In accordance with embodiments, there are provided mechanisms andmethods for monitoring data activity utilizing a shared data store.These mechanisms and methods for monitoring data activity utilizing ashared data store can enable enhanced data monitoring, more efficientdata storage, improved system resource utilization, etc.

In an embodiment and by way of example, a method for monitoring, dataactivity utilizing a shared data store is provided. In one embodiment,data activity is monitored within a system. Additionally, the monitoreddata activity is stored within a shared data store. Further, one or moreactions are performed, based on the stored data activity.

While one or more implementations and techniques are described withreference to an embodiment in which monitoring data activity utilizing ashared data store is implemented in a system having an applicationserver providing a front end for an on-demand database system capable ofsupporting multiple tenants, the one or more implementations andtechniques are not limited to multi-tenant databases nor deployment onapplication servers. Embodiments may be practiced using other databasearchitectures, i.e., ORACLE®, DB2® by IBM and the like without departingfrom the scope of the embodiments claimed.

Any of the above embodiments may be used alone or together with oneanother in any combination. The one or more implementations encompassedwithin this specification may also include embodiments that are onlypartially mentioned or alluded to or are not mentioned or alluded to atall in this brief summary or in the abstract. Although variousembodiments may have been motivated by various deficiencies with theprior art, which may be discussed or alluded to in one or more places inthe specification, the embodiments do not necessarily address any ofthese deficiencies. In other words, different embodiments may addressdifferent deficiencies that may be discussed in the specification. Someembodiments may only partially address some deficiencies or just onedeficiency that may be discussed in the specification, and someembodiments may not address any of these deficiencies.

BRIEF DESCRIPTION OF THE DRAWINGS

In the following drawings like reference numbers are used to refer tolike elements. Although the following figures depict various examples,the one or more implementations are not limited to the examples depictedin the figures.

FIG. 1 illustrates a method for monitoring data activity utilizing ashared data store, in accordance with one embodiment;

FIG. 2 illustrates a method for handling concurrent requests utilizing ashared data store, in accordance wish another embodiment;

FIG. 3 illustrates a method for performing tracking with limitingutilizing a shared data store, in accordance with another embodiment;

FIG. 4 illustrates a method for performing persistent data storageutilizing a shared data store, in accordance with another embodiment;

FIG. 5 illustrates a block diagram of an example of an environmentwherein an on-demand database system might be used; and

FIG. 6 illustrates a block diagram of in embodiment of elements of FIG.4 and various possible interconnections between these elements.

DETAILED DESCRIPTION General Overview

Systems and methods are provided for monitoring data activity utilizinga shared data store.

As used herein, the term multi-tenant database system refers to thosesystems in which various elements of hardware and software of thedatabase system may be shared by one or more customers. For example, agiven application server may simultaneously process requests for a greatnumber of customers, and a given database table may store rows for apotentially much greater number of customers.

Next, mechanisms and methods for monitoring data activity utilizing ashared data store will be described with reference to exampleembodiments.

FIG. 1 illustrates a method 100 for monitoring data activity utilizing ashared data store, in accordance with one embodiment. As shown inoperation 102, data activity is monitored within a system. In oneembodiment, the data activity may be associated with one or more usersof the system. For example, the data activity may be associated with auser of the system, a customer of the system, etc. In anotherembodiment, the data activity may be associated with an application. Forexample, the data activity may be associated with a client function, anapplication provided by the system, etc. In yet another embodiment, thesystem may include one or more clients and/or servers, a multi-tenanton-demand database system, etc. For example, the system may include aplurality of servers (e.g., application servers, etc.) within a cluster.

Additionally, in another embodiment, the data activity may include anamount of data that is transferred utilizing the system. For example,the data activity may include a number of bytes of data transferredbetween the system and a customer. In another example, the data activitymay include a number of application programming interface (API) callsmade to the system by a customer. In yet another embodiment, the dataactivity may include an amount of processing being performed by one ormore servers of the system. For example, the data activity may include anumber of data requests received from a customer that are currentlybeing serviced by one or more application servers of the system.

Further, in one embodiment, the data activity may be monitored for apredetermined amount of time. For example, the data activity may bemonitored for a time period of a month, a week, twenty-four hours, etc.Of course, however, the data activity may be monitored for any period oftime. In another embodiment, the data activity may include data usage ata particular point in time (e.g., a snapshot of the current activitywithin the system, etc.).

Additionally, it should be noted that, as described above, suchmulti-tenant on-demand database system may include any service thatrelies on a database system that is accessible over a network, in whichvarious elements of hardware and software of the database system may beshared by one or more customers (e.g. tenants). For instance, a givenapplication server may simultaneously process requests for a greatnumber of customers, and a given database table may store rows for apotentially much greater number of customers. Various examples of such amulti-tenant on-demand database system will be set forth in the contextof different embodiments that will be described during reference tosubsequent figures.

Furthermore, as shown in operation 104, the monitored data activity isstored within a shared data store. In one embodiment, the shared datastore may include an open data store. For example, the shared data storemay include a general purpose distributed memory caching system (e.g.,memcached, etc.).

Further still, as shown in operation 106, one or more actions areperformed, based on the stored data activity. In one embodiment, the oneor more actions may include creating a billing statement. For example,the one or more actions may include creating a bill and sending the billto a customer of the system based on their monitored data activitywithin the system. In another embodiment, the one or more actions mayinclude blocking or redirecting one or more elements within the system.For example, the one or more actions may include denying a request fordata from a customer or function, queuing the request for data from thecustomer or function, etc.

In this way, the shared data store may be used instead of a database tostore the monitored data activity. Additionally, the shared data storemay provide a simple, easy to understand framework that may enabledevelopers to easily meter and profile features or sub-systems of thesystem.

FIG. 2 illustrates a method 200 for handling concurrent requestsutilizing a shared data store, in accordance with another embodiment. Asan option, the present method 200 may be carried out in the context ofthe functionality of FIG. 1. Of course, however, the method 200 may becarried out in any desired environment. The aforementioned definitionsmay apply during the present description.

As shown in operation 202, each application server within a systemstores a key containing a hash of a list of all running applicatorservers within the system. In one embodiment, each application servermay be aware of all other application servers within the system that arecurrently operational, and may store the key containing a hash of a listof all application servers within the system based on that knowledge.

Additionally, as shown in operation 204, the application server storesthe key in association with a customer request count within the shareddata store. In one embodiment, the customer request count may include avalue indicative of a number of requests made to the application serversby a particular customer. In another embodiment, what a request isreceived and started by an application server, the customer requestcount is incremented. Also, in yet another embodiment, when a request iscompleted and ended by the application server, the customer requestcount is decremented.

Further, as shown in operation 206, one of the plurality of applicationservers within the system is lost. For example, an application servermay shut down, may be non-responsive, may crash, etc. Further still, asshown in operation 208, in response to losing the application server,the hash of the list of all running application servers is altered,thereby altering the corresponding key containing the hash. Also, asshown in operation 210, the customer request count is reset to zero inresponse to the alteration of the hash.

In this way, if an application server that starts a request is lost,that request may not count against the customer request count, and thecustomer who sent the request may not be unjustly blocked due to lostupdates. Additionally, if the customer request count within the shareddata store is lost before one or more requests have ended, the customerrequest count may not be decremented below zero. This may enable thesystem to determine a number of outstanding requests from each customerthat are being serviced by application servers of the system, andregulate the number of allowable customer requests accordingly.

FIG. 3 illustrates a method 300 for performing tracking with limitingutilizing a shared data store, in accordance with another embodiment. Asan option, the present method 300 may be carried out in the context ofthe functionality of FIGS. 1-2. Of course, however, the method 300 maybe carried out in any desired environment. The aforementioneddefinitions may apply during the present description.

As shown in operation 302, a customer count value is determined for acurrent predetermined time period. For example, a count value indicativeof a number of requests made by a customer for a current hour timeperiod may be determined. Additionally, as shown in operation 304, anaggregate key is determined for a second time period by concatenating apredetermined amount of earlier customer count values with the currentcustomer count value. For example, an aggregate key may be compiled fora twenty-four hour time period by concatenating the last twenty-threecustomer count values with the current customer count value. In thisway, a rolling twenty-four hour window may be created.

Further, in one embodiment, if the shared data store loses an aggregatevalue, the aggregate key may be recalculated utilizing the predeterminedamount of earlier customer count values as well as the current customercount value. In this way, tracking of customer requests may be performedwithout persistence. Further still, a customer may be limited to apredetermined amount of requests (e.g., API calls, data requests,processing requests, etc.) over a predetermined period of time utilizingthe aggregate key.

FIG. 4 illustrates a method 400 for performing persistent data storageutilizing a shared data store, in accordance with another embodiment. Asan option, the present method 400 may be carried out in the context ofthe functionality of FIGS. 1-3. Of course, however, the method 400 maybe carried out in any desired environment. The aforementioneddefinitions may apply during the present description.

As shown in operation 402, every application server of a systemidentifies a list of keys stored to the shared data store within apredetermined time interval. In one embodiment, the time interval may beone minute, five minutes, an hour, a day, etc. Additionally, as shown inoperation 404, during another predetermined time interval, eachapplication server agrees on a particular key or set of keys to appendto. Further, as shown in operation 406, each of the application serversappend to the particular key the names of all keys that have beenupdated within the other predetermined time interval.

Further still, as shown in operation 408, a designated persister isdetermined from the application servers. In one embodiment, thedesignated persister may be elected by all of the application servers.In another embodiment, all application servers may attempt to perform asthe designated persister and may become the designated persister if noother application server has indicated an attempt to become thedesignated persister.

Also, as shown in operation 410, the designated persister selects theparticular key, retrieves values for all the listed keys within theparticular key, and persists such values to the shared data store. Inthis way, a list of keys that have not been persisted may be stored oneach application server. Additionally, a total count of activity may bestored persistently for a customer of the system during a predeterminedtime period for purposes of billing the customer for such activity.

Additionally, in one embodiment, a cluster aware data store may be movedfrom a database to memcached. Additionally, a new, simple,easy-to-understand framework may be provided that developers may use tometer and profile features or sub-systems. In another embodiment,interval based limiting maybe performed in order to measure an amount ofactivity occurring within a predetermined time interval, and may provideways for clients to ask for permission to perform the activity.Additionally, this data may be aggregated across all servers in acluster. Further, when an amount of activity within a predeterminedinterval surpasses a threshold, then some type of policy may beenforced. For example, when an organization exceeds a predeterminednumber of API requests in an hour time period, then all further APIrequests may be blocked until the number of requests drops below thethreshold again. In another embodiment, the captured data may bepersisted to a database for historical or auditing purposes.

Further still, in one embodiment, concurrent based activity may measureconcurrent activity, and may provide ways for clients to ask forpermission to perform the activity. In another embodiment, this data mayneed to be aggregated across all servers in a cluster. For example, anamount of concurrent long running requests may be monitored for a givenorganization, and when the limit is exceeded, further requests may bedenied until the amount of requests drops below the threshold. In yetanother embodiment, limits may be elastic and not static. For example,an unbounded number of reports may be allowed to be concurrently runwhen database CPU utilization is low, but as utilization grows higher,much lower concurrent numbers may be enforced.

Also, in another embodiment, historical profiling may not include anotion of “limiting” or “restricting.” Rather, it may only care aboutcapturing events or data, possibly by time interval, that may bepersisted for use by others. This data may not need to be aggregatedacross all servers in a cluster—rather, each server in the cluster mayonly need to capture and then flush its own data to some central datastore. This may be thought of as a feature of resource profiling, and anexample today may include capturing knowledge base article views thatmay only be used for reporting purposes.

Additionally, in one embodiment, one implementation may be decomposedinto a manageable set of interfaces and base implementations, all ofwhich may be hidden to clients. Rather clients may be able to use any ofthe supported use cases via implementations already provided, and theymay customize those implementations via framework specific objectspassed to constructor calls and/or factory methods. A developer wantingto track some activity, possibly with limits enforced, may code this upin minutes, not hours or days, with very few lines of new code.

Further, in another embodiment, the central data store to synchronizedata across servers in the cluster may no longer be the database. Forexample, using clustered memcached may result in removing much of theheavy load that older designs pull on a database. In yet anotherembodiment, all working transient data seeded to make limiting decisionsmay be pushed to memcached. Oracle may no longer be involved, such thatlocally collected data may be flushed to memcached, and whencluster-wide data is needed to make a decision it may be retrieved frommemcached.

In yet another embodiment, the memory footprint of metered data may bereduced in app servers. Additionally, all data may never be synchronizedback into all application servers, but instead when a request for datais made on a giver application server the values in the local data cachemay be summed with the cluster's values stored in memcached, which mayeliminate the need to store all cluster-wide data on each app server.

Further still, in one embodiment, the shared data store (e.g.,memcached, etc.) may be a transient data store. For example, when agiven memcached server in the cluster goes down, all data that was beingkept on that server may be lost. In another embodiment, if animplementation cannot tolerate lossy behavior, then an Oracle specificclustered data store implementation may be used. In yet anotherembodiment, for implementations that may require permanent storage oftheir data, they may flush to Oracle from the app server's local cacheindependently of the flush and usage of memcached and therefore may notbe affected by memcached server crashes.

In another embodiment, there may be implementations that may requireinteraction with Oracle. These implementations may want to preservetheir data permanently (or at least for a longer period of time than thecurrent time interval they're working in). This may apply to some“Interval Activity” and all “Historical Profiling” use caseimplementations. For these implementations, their flush to Oracle maynot be frequent (lessening the excessive churn seen in the current RLdesign), and it may be a one way push (meaning they don't need toretrieve data to sync up cluster-wide activity, since cluster-wide datausage may be handled through memcached).

For example, the “Historical Profiling” use case may include flushinglocal cache data to Oracle once every 10 minutes. Additionally, the“Interval Activity” use case may need persistence. For example, it mayfrequently (e.g., every 30 seconds, 2 minutes, etc.) flush a local cachedata to memcached, but may flush this same local data to Oracle onceover 10 minutes.

Also, in one embodiment, for implementations that need to persist theirdata to Oracle, “sleeping” or purging their old data may be performed.In another embodiment, instead of requiring the client implementation tomanage and write the code for this, a simple interface may be providedinto defining the sweeping interval for the client's data and thenhandling the scheduling and executing of their data's sweeping on theirbehalf.

Additionally, in one embodiment, a concurrent based activity model maybe introduced with elastic permitting that may enable a self-protectingsystem. For example, under normal load, requests to run reports mayalways be approved. However, as database CPU utilization on a given nodeclimbs to a predetermined level, one or more reporting requests may beshed or delayed in response. Also, classifications and priorities ofreports and customers may also be supported, such that lower priorityorganizations and/or historically more expensive reports may be may beshed or delayed first.

In another embodiment, Apex activity may be metered within hourintervals, and limits may be enforced after a predetermined threshold isexceeded for that time interval. Additionally, metering may be utilizedto capture and/or monitor system activity. In yet another embodiment,the metering framework may take care of periodically flushing data fromthe appservers where activity occurs to memcached (thus adding thoselocal values to the overall count for entire cluster). In still anotherembodiment, the Metering framework may also periodically flush data toOracle, and it may reside in core.metering_count. The default flush tomemcached interval may be two minutes, and to Oracle every twentyminutes. These intervals may be overridden by using methods withinCountMeteringFactory that may expose these parameters.

Further, in one embodiment, metrics may be tracked over a particulartime interval. For example, metrics may be tracked over a fixed day, arolling twenty-four hour period, etc. Additionally, a rolling intervalmay include a period chopped into various sub-units of time, where whena new unit is “rolled into” the oldest unit “rolls off.” For example, ina rolling twenty-four hour period, activity may be tracked each hour forthe past twenty-four hours. Additionally, when a new hour is “rolledinto” then all activity on the now twenty-fifth hour no longer countstowards the twenty four hour total.

In another embodiment, data may be permanently persisted. For example,data may be flushed to a database so that it may be used for otherpurposes, such as historical reporting, billing, etc. Also, in oneembodiment, static limits may be used in order to enforce a fixed numberof concurrent activity (e.g., an organization may only have fiveinstances of an action occurring at any point in time, etc.). In anotherembodiment, fixed limits may vary by another condition. In yet anotherembodiment, elastic limits may be used that vary over time. For example,a varying number of concurrent reports may be allowed to be executedbased on a utilization level of a targeted node.

Further, in one embodiment, usage of computational resources may bemetered to provide a general purpose resource metering framework. Forexample, metering may count, sum, etc. some type of activity occurringwithin the service, possibly on a per customer/tenant basis. It may thenmake this data available to all machines in the service, allowing actionto be taken when thresholds are met or exceeded. This data may be madeavailable to the service through a shared memory architecture, which maybe provided via a clustered memcached caching layer. The facility may beprovided to flush activity to the database in case historical records ofthe activity is needed.

Further still, in one embodiment, two primary methods of trackingactivity are supported—an aggregate count over some window of time (sayover an hour period, or rolling 24 hour period, etc.), and the amount ofactivity happening concurrently. For concurrent activityimplementations, the limit may either by statically defined or be“elastic”. For the elastic version, it may vary the amount of allowedconcurrent activity based on the current levels of resource utilizationfor some resource that is measured. For example, the number ofconcurrent reports that can be running may be varied based on thecurrent level of utilization of the database CPU. Hence, whenutilization is low more reports may be allowed to be concurrentlyrunning, but when utilization is high less reports may be allowed to beconcurrently running. Thus, activity tracking and concurrent (static orelastic) activity tracking may be provided. Also, in one embodiment, themetering may be performed in association with a multi-tenant on-demanddatabase system.

System Overview

FIG. 5 illustrates a block diagram of an environment 510 wherein anon-demand database system might be used. Environment 510 may includeuser systems 512, network 514, system 516, processor system 517,application platform 518, network interlace 520, tenant data storage522, system data storage 524, program code 526, and process space 528.In other embodiments, environment 510 may not have all of the componentslisted and/or may have other elements instead of, or in addition to,those listed above.

Environment 510 is an environment in which an on-demand database systemexists. User system 512 may be any machine or system that is used by auser to access a database user system. For example, any of user systems512 can be a handheld computing device, a mobile phone, a laptopcomputer, a work station, and/or a network of computing devices. Asillustrated in FIG. 5 (and in more detail in FIG. 6) user systems 512might interact via a network 514 with an on-demand database system,which is system 516.

An on-demand database system, such as system 516, is a database systemthat is made available to outside users that do not need to necessarilybe concerned with building and/or maintaining the database system, butinstead may be available for their use when the users need the databasesystem (e.g., on the demand of the users). Some on-demand databasesystems may store information from one or more tenants stored intotables of a common database image to form a multi-tenant database system(MTS). Accordingly, “on-demand database system 516” and “system 516”will be used interchangeably herein. A database image may include one ormore database objects. A relational database management system (RDMS) orthe equivalent may execute storage and retrieval of information againstthe database object(s). Application platform 518 may be a framework thatallows the applications of system 516 to run, such as the hardwareand/or software, e.g., the operating system. In an embodiment, on-demanddatabase system 516 may include an application platform 518 that enablescreation, managing and executing one or more applications developed bythe provider of the on-demand database system, users accessing theon-demand database system via user systems 512, or third partyapplication developers accessing the on-demand database system via usersystems 512.

The users of user systems 512 may differ in their respective capacities,and the capacity of a particular user system 512 might be entirelydetermined by permissions (permission levels) tor the current user. Forexample, where a salesperson is using a particular user system 512 tointeract with system 516, that user system has the capacities allottedto that salesperson. However, while an administrator is using that usersystem to interact with system 516, that user system has the capacitiesallotted to that administrator. In systems with a hierarchical rolemodel, users at one permission level may have access to applications,data, and database information accessible by a lower permission leveluser, but may not have access to certain applications, databaseinformation, and data accessible by a user at a higher permission level.Thus, different users will have different capabilities with regard toaccessing and modifying application and database information, dependingon a user's security or permission level.

Network 514 is any network or combination of networks of devices thatcommunicate with one another. For example, network 514 can be any one orany combination of a LAN (local area network), WAN (wide area network),telephone network, wireless network, point-to-point network, starnetwork, token ring network, hub network, or other appropriateconfiguration. As the most common type of computer network in currentuse is a TCP/IP (Transfer Control Protocol and Internet Protocol)network, such as the global internetwork of networks often referred toas the “Internet” with a capital “I,” that network will be used in manyof the examples herein. However, it should be understood that thenetworks that the one or more implementations might use are not solimited, although TCP/IP is a frequently implemented protocol.

User systems 512 might communicate with system 516 using TCP/IP and, ata higher network level, use other common Internet protocols tocommunicate, such as HTTP, FTP, AFS, WAP, etc. In an example where HTTPis used user system 512 might include an HTTP client commonly referredto as a “browser” for sending and receiving HTTP messages to and from anHTTP server at system 516. Such an HTTP server might be implemented asthe sole network interface between system 516 and network 514, but othertechniques might be used us well or instead. In some implementations,the interface between system 516 and network 514 includes load sharingfunctionality, such as round-robin HTTP request distributors to balanceloads and distribute incoming HTTP requests evenly over a plurality ofservers. At least as for the users that are accessing that server, eachof the plurality of servers has access to the MTS' data; however, otheralternative configurations may be used instead.

In one embodiment, system 516, shown in FIG. 5, implements a web-basedcustomer relationship management (CRM) system. For example, in oneembodiment, system 516 includes application servers configured toimplement and execute CRM software applications as well as providerelated data, code, forms, webpages and other information to and fromuser systems 512 and to store to, and retrieve from, a database systemrelated data, objects, and Webpage content. With a multi-tenant system,data for multiple tenants may be stored in the same physical databaseobject, however, tenant data typically is arranged so that data of onetenant is kept logically separate from that of other tenants to that onetenant does not have access to another tenant's data, unless such datais expressly shared. In certain embodiments, system 516 implementsapplications other than, or in addition to, a CRM application. Forexample, system 516 may provide tenant access to multiple hosted(standard and custom) applications, including a CRM application. User(or third party developer) applications, which may or may not includeCRM, may be supported by the application platform 518, which managescreation, storage of the applications into one or more database objectsand executing of the applications in a virtual machine in the processspace of the system 516.

One arrangement for elements of system 516 is shown in FIG. 5, includinga network interface 520, application platform 518, tenant data storage522 for tenant data 523, system data storage 524 for system data 525accessible to system 516 and possibly multiple tenants, program code 526for implementing various functions of system 516, and a process space528 for executing MTS system processes and tenant-specific processes,such as running applications as part of an application hosting service.Additional processes that may execute on system 516 include databaseindexing processes.

Several elements in the system shown in FIG. 5 include conventional,well-known elements that are explained only briefly here. For example,each user system 512 could include a desktop personal computer,workstation, laptop, PDA, cell phone, or any wireless access protocol(WAP) enabled device or any other computing device capable ofinterfacing directly or indirectly to the Internet or other networkconnection. User system 512 typically runs an HTTP client, e.g., abrowsing program, such as Microsoft's Internet Explorer browser,Netscape's Navigator browser, Opera's browser, or a WAP-enabled browserin the ease of a cell phone, PDA or other wireless device, or the like,allowing a user (e.g., subscriber of the multi-tenant database system)of user system 512 to access, process and view information, pages andapplications available to it from system 516 over network 514. Each usersystem 512 also typically includes one or more user interface devices,such as a keyboard, a mouse, trackball, touch pad, touch screen, pen orthe like, for interacting with a graphical user interface (GUI) providedby the browser on a display (e.g., a monitor screen, LCD display, etc.)in conjunction with pages, forms, applications and other informationprovided by system 516 or other systems or servers. For example, theuser interface device can be used to access data and applications hostedby system 516, and to perform searches on stored data, and otherwiseallow a user to interact with various GUI pages that may be prevented toa user. As discussed above embodiments are suitable for use with theInternet, which refers to a specific global internetwork of networks.However, it should be understood that other networks can be used insteadof the Internet, such as an intranet, an extranet, a virtual privatenetwork (VPN), a non-TCP/IP based network, any LAN or WAN or the like.

According to one embodiment, each user system 512 and all of itscomponents are operator configurable using applications, such as abrowser, including computer code run using a central processing unitsuch as an Intel Pentium® processor or the like. Similarly, system 516(and additional instances of an MTS, where more than one is present) andall of their components might be operator configurable usingapplication(s) including computer code to run using a central processingunit such as processor system 517, which may include an Intel Pentium®processor or the like, and/or multiple processor units. A computerprogram product embodiment includes a machine-readable storage medium(media) having instructions stored thereon in which can be used toprogram a computer to perform any of the processes of the embodimentsdescribed herein. Computer code for operating and configuring system 516to intercommunicate and to process webpages, applications and other dataand media content as described herein are preferably downloaded andstored on a hard disk, but the entire program code, or portions thereof,may also be stored in any other volatile or non-volatile memory mediumor device as is well known, such as a ROM or RAM, or provided on anymedia capable of storing program code, such as any type of rotatingmedia including floppy disks, optical discs, digital versatile disk(DVD), compact disk (CD), microdrive, and magneto-optical disks, andmagnetic or optical cards, nanosystems (including molecular memory ICs),or any type of media or device suitable for storing instructions and/ordata. Additionally, the entire program code, or portions thereof, may betransmitted and downloaded from a software source over a transmissionmedium, e.g., over the Internet, or from another server, as is wellknown, or transmitted over any other conventional network connection asis well known (e.g., extranet, VPN, LAN, etc.) using any communicationmedium and protocols (e.g. TCP/IP, HTTP, HTTPS, Ethernet, etc.) as arewell known. It will also be appreciated that computer code forimplementing embodiments can be implemented in any programming languagethat can be executed on a client system and/or server or server systemsuch as, for example, C, C++, HTML, any other markup language, Java™,JavaScript, ActiveX, any other scripting language, such as VBScript, andmany other programming languages as are Well known may be used. (Java™is a trademark of Sun Microsystems, Inc.).

According to one embodiment, each system 516 is configured to providewebpages, forms, applications, data and media content to user (client)systems 512 to support the access by user systems 512 as tenants ofsystem 516. As such, system 516 provides security mechanisms to keepeach tenant's data separate unless the data is shared. If more than oneMTS is used, the may be located in close proximity to one another (e.g.,in a server farm located in a single building or campus), or they may bedistributed at locations remote from one another (e.g., one or moreservers located in city A and one or more servers located in city B). Asused herein, each MTS could include one or more logically and/orphysically connected servers distributed locally or across one or moregeographic locations. Additionally, the term “server” is meant toinclude a computer system, including processing hardware and processspace(s), and an associated storage system and database application(e.g., OODBMS or RDBMS) as is well known in the art. It should also beunderstood that “server system” and “server” are often usedinterchangeably herein. Similarly, the database object described hereincan be implemented as single databases, a distributed database, acollection of distributed databases, a database with redundant online oroffline backups or other redundancies, etc., and might include adistributed database or storage network and associated processingintelligence.

FIG. 6 also illustrates environment 510. However, in FIG. 6 elements ofsystem 516 and various interconnections in an embodiment are furtherillustrated. FIG. 6 shows that user system 512 may include processorsystem 512A, memory system 512B, input system 512C, and output system512D. FIG. 6 shows network 514 and system 516. FIG. 6 also shows thatsystem 516 may include tenant data storage 522, tenant data 523, systemdata storage 524, system data 525, User Interface (UI) 630, ApplicationProgram Interface (API) 632, PL/SOQL 634, save routines 636, applicationsetup mechanism 638, applications servers 600 ₁-600 _(N), system processspace 602, tenant process spaces 604, tenant management process space610, tenant storage area 612, user storage 614, and application metadata616. In other embodiments, environment 510 may not have the sameelements to those lifted above and/or may have other elements insteadof, or in addition to, those listed above.

User system 512, network 514, system 516, tenant data storage 522, andsystem data storage 524 were discussed above in FIG. 5. Regarding usersystem 512, processor system 512A may be any combination of one or moreprocessors. Memory system 512B may be any combination of one or morememory devices, short term, and/or long term memory. Input system 512Cmay be any combination of input devices, such as one or more keyboards,mice, trackballs, scanners, cameras, and/or interfaces to networks.Output system 512D may be any combination of output devices, such as oneor more monitors, printers, and or interfaces to networks. As shown byFIG. 6, system 516 may include a network interface 520 (of FIG. 5)implemented as a set of HTTP application servers 600, an applicationplatform 518, tenant data storage 522, and system data storage 524. Alsoshown is system process space 602, including individual tenant processspaces 604 and a tenant management process space 610. Each applicationserver 600 may be configured to tenant data storage 522 and the tenantdata 523 therein, and system data storage 524 and the system data 525therein to serve requests of user systems 512. The tenant data 523 mightbe divided into individual tenant storage areas 612, which can be eithera physical arrangement and/or a logical arrangement of data. Within eachtenant storage area 612, user storage 614 and application metadata 616might be similarly allocated for each user. For example, a copy of auser's most recently used (MRU) items might be stored to user storage614. Similarly, a copy of MRU items for an entire organization that is atenant might be stored to tenant storage area 612. A UI 630 provides auser interface and an API 632 provides an application programmerinterface to system 516 resident processes to users and/or developers atuser systems 512. The tenant data and the system data may be stored invarious databases, such as one or more Oracle™ databases.

Application platform 518 includes an application setup mechanism 638that supports application developers' creation and management ofapplications, which may be saved as metadata into tenant data storage522 by save routines 636 for execution by subscribers as one or moretenant process spaces 604 managed by tenant management process 610 forexample. Invocations to such applications may be coded using PL/SOQL 634that provides a programming language style interface extension to API632. A detailed description of some PL/SOQL language embodiments isdiscussed in commonly owned co-pending U.S. Provisional PatentApplication 60/828,192 entitled, PROGRAMMING LANGUAGE METHOD AND SYSTEMFOR EXTENDING APIS TO EXECUTE IN CONJUNCTION WITH DATABASE APIS, byCraig Weissman, filed Oct. 4, 2006, which is incorporated in itsentirety herein for all purposes. Invocations to applications may bedetected by ore or more system processes, which manages retrievingapplication metadata 616 for the subscriber making the invocation andexecuting the metadata as an application in a virtual machine.

Each application server 600 may be communicably coupled to databasesystems, e.g., having access to system data 525 and tenant data 523, viaa different network connection. For example, one application server 600₁ might be coupled via the network 514 (e.g., the Internet), anotherapplication server 600 _(N-1) might be coupled via a direct networklink, and another application server 600 _(N) might be coupled by yet adifferent network connection. Transfer Control Protocol and InternetProtocol (TCP/IP) are typical protocols for communicating betweenapplication servers 600 and the database system. However, it will beapparent to one skilled in the art that other transport protocols may beused to optimize the system depending on the network interconnect used.

In certain embodiments, each application server 600 is configured tohandle requests for any user associated with any organization that is atenant. Because it is desirable to be able to add and remove applicationservers from the server pool at any time for any reason, there ispreferably no server affinity for a user and/or organization to aspecific application server 600. In one embodiment, therefore, aninterface system implementing a load balancing function (e.g., an F5Big-IP load balancer) is communicably coupled between the applicationservers 600 and the user systems 512 to distribute requests to theapplication servers 600. In one embodiment, the load balancer uses aleast connections algorithm to route user requests to the applicationservers 600. Other examples of load balancing algorithms, such as roundrobin and observed response time, also can be used. For example, incertain embodiments, three consecutive requests from the same user couldhit three different application servers 600, and three requests fromdifferent users could hit the same application server 600. In thismanner, system 516 is multi-tenant, wherein system 516 handles storageof, and access to, different objects, data and application acrossdisparate users and organizations.

As an example of storage, one tenant might be a company that employs asales force where each salesperson uses system 516 to manage their salesprocess. Thus, a user might maintain contact data, leads data, customerfollow-up data, performance data, goals and progress data, etc., allapplicable to that user's personal sales process (e.g., in tenant datastorage 522). In an example of a MTS arrangement, since all of the dataand the applications to access, view, modify, report, transmit,calculate, etc., can be maintained and accessed by a user system havingnothing more than network access, the user can manage his or her salesefforts and cycles from any of many different user systems. For example,if a salesperson is visiting a customer and the customer has Internetaccess in their lobby, the salesperson can obtain critical updates as tothat customer while waiting for the customer to arrive in the lobby.

While each user's data might be separate from other users' dataregardless of the employers of each user, some data might beorganization-wide data shared or accessible by a plurality of users orall of the users for a given organization that is a tenant. Then, theremight be some data structures managed by system 516 that are allocatedat the tenant level while other data structures might be managed at theuser level. Because an MTS might support multiple tenants includingpossible competitors, the MTS should have security protocols that keepdata, applications, and application use separate. Also, because manytenants may opt for access to an MTS rather than maintain their ownsystem, redundancy, up-time, and backup are additional functions thatmay be implemented in the MTS. In addition to user-specific data andtenant specific data, system 516 might also maintain system level datausable by multiple tenants or other data. Such system level data mightinclude industry reports, news, postings, and the like that are sharableamong tenants.

In certain embodiments, user systems 512 (which may be client systems)communicate with application servers 600 to request and updatesystem-level and tenant-level data from system 516 that may requiresending one or more queries to tenant data storage 522 and/or systemdata storage 524. System 516 (e.g., an application server 600 in system516) automatically generates one or more SQF statements (e.g., one ormore SQL queries) that are designed to access the desired information.System data storage 524 may generate query plans to access the requesteddata from the database.

Each database can generally be viewed as a collection of objects, suchas a set of logical tables, containing data filled into predefinedcategories. A “table” is one representation of a data object, and may beused herein to simplify the conceptual description of objects and customobjects. It should be understood that “table” and “object” may be usedinterchangeably herein. Each table generally contains one or more datacategories logically arranged as columns or fields in a viewable schema,each row or record of a table contains an instance of data for eachcategory defined by the fields. For example, a CRM database may includea table that describes a customer with fields for basic contactinformation such as name, address, phone number, fax number, etc.Another table might describe a purchase order, including fields forinformation such as customer, product, sale price, date, etc. In somemulti-tenant database systems, standard entity tables might be providedfor use by all tenants. For CRM database applications, such standardentities might include tables for Account, Contact, Lead, andOpportunity data, each containing pre-defined fields. It should beunderstood that the word “entity” may also be used interchangeablyherein with “object” and “table”.

In some multi-tenant database systems, tenants may be allowed to createand store custom objects, or they may be allowed to customize standardentities or objects, for example by creating custom fields for standardobjects, including custom index fields. U.S. patent application Ser. No.10/817,161, filed Apr. 2, 2004, entitled “Custom Entities and Fields ina Multi-Tenant Database System”, and which is hereby incorporated hereinby reference, teaches systems and methods for creating custom objects aswell as customizing standard objects in a multi-tenant database system.In certain embodiments, for example, all custom entity data rows arestored in a single multi-tenant physical table, which may containmultiple logical tables per organization. It is transparent to customersthat their multiple “tables” are in fact stored in one large table orthat their data may be stored in the same table as the data of othercustomers.

While one or more implementations have been described by way of exampleand in terms of the specific embodiments, it is to be understood thatone or more implementations are not limited to the disclosedembodiments. To the contrary, it is intended to cover variousmodifications and similar arrangements as would be apparent to thoseskilled in the art. Therefore, the scope of the appended claims shouldbe accorded the broadest interpretation so as to encompass all suchmodifications and similar arrangements.

1. A computer program product, comprising a non-transitory computerusable medium having a computer readable program code embodied therein,the computer readable program code adapted to be executed by a computerto implement a method comprising: identifying, by a database system thatincludes a plurality of servers and a distributed memory cache shared bythe servers, data activity performed across the servers, the dataactivity including events associated with a user system coupled to thedatabase system, wherein identifying the data activity comprisesactivity tracking using a request count within the distributed memorycache, storing, by the database system, first information indicating theidentified data activity; following the storing of the firstinformation, moving a portion of the first information to thedistributed memory cache; generating, by the database system, secondinformation associated with the data activity from contents of thedistributed memory cache, wherein the generated second information isbased on a total count of activity indicated by the request count; andproviding the user system with access to the generated secondinformation.
 2. The computer program product of claim 1, wherein thedata activity is associated with one or more users associated with theuser system.
 3. The computer program product of claim 1, wherein thedata activity is associated with an application available to the usersystem from the database system.
 4. The computer program product ofclaim 1, wherein the database system includes a multi-tenant databasesystem.
 5. The computer program product of claim 1, wherein the dataactivity relates to data that is transferred to the database system. 6.The computer program product of claim 1, wherein the data activityrelates to application programming interface (API) calls made to thedatabase system.
 7. The computer program product of claim 1, wherein theportion of the first information includes data activity performed duringa most recent predetermined period of time.
 8. The computer programproduct of claim 1, further comprising: storing, within a database ofthe database system, the first information; and moving the portion ofthe first information from the database to the distributed memory cache.9. A method, comprising: identifying, by a database system that includesa plurality of servers and a distributed memory cache shared by theservers, data activity performed across the servers, the data activityincluding events associated with a user system coupled to the databasesystem, wherein identifying the data activity comprises activitytracking using a request count within the distributed memory cache;storing, by the database system, first information indicating theidentified data activity; following the storing of the firstinformation, moving a portion of the first information to thedistributed memory cache; generating, by the database system, secondinformation associated with the data activity from contents of thedistributed memory cache, wherein the generated second information isbased on a total count of activity indicated by the request count; andproviding the user system with access to the generated secondinformation.
 10. The method of claim 9, wherein the portion of the firstinformation includes data activity performed during a most recentpredetermined period of time.
 11. The method of claim 10, furthercomprising: storing, within a database of the database system, the firstinformation; and moving the portion of the first information from thedatabase to the distributed memory cache.
 12. An apparatus, comprising:a processor of a database system, the database system including aplurality of servers and a distributed memory cache shared by theservers, the processor to: identify data activity performed across theservers, the data activity including events associated with a usersystem coupled to the database system, wherein identity the dataactivity comprises activity tracking using a request count within thedistributed memory cache; store first information indicating theidentified data activity; following storage of the first information,move a portion of the first information to the distributed memory cache;generate second information associated with the data activity fromcontents of the distributed memory cache, wherein the generated secondinformation is based on a total count of activity indicated by therequest count; and provide the user system with access to the generatedsecond information.
 13. The apparatus of claim 12, wherein the dataactivity is associated with one or more users associated with the usersystem.
 14. The apparatus of claim 12, wherein the data activity isassociated with an application available to the user system from thedatabase system.
 15. The apparatus of claim 12, wherein the databasesystem includes a multi-tenant database system.
 14. The apparatus ofclaim 12, wherein the data activity relates to data that is transferredto the database system.
 17. The apparatus of claim 12, wherein the dataactivity relates to application programming interface (API) calls madeto the database system.
 18. The apparatus of claim 12, wherein theportion of the first information includes data activity performed duringa most recent predetermined period of time.
 19. The apparatus of claim10, the processor further to: store, within a database of the databasesystem, the first information; and move the portion of the firstinformation from the database to the distributed memory cache.